// 页面中类型定义

export interface ResData<T> {
  code: number
  message: string
  data: T
}

export interface Pagination {
  current: number
  size: number
  total: number
}

/**
 * 用户数据接口
 */
export interface Records {
  id?: string
  username: string
  password?: string
  roleName?: string
  name?: string
  phone?: string
  createdAt?: string
  updatedAt?: string
}

/**
 * 表单数据接口,通用数据接口
 */
export type FormData = Partial<Records>

// pagelist 接口
export interface PageList {
  records: Records[]
  searchCount: boolean
  size: number
  total: number
  current: number
}

export type ResPageList = ResData<PageList>

// 定义搜索参数类型，避免与 Record 接口命名冲突
export type SearchParams = { [key: string]: unknown }
